package cn.ztuo.bitrade.service;

import cn.ztuo.bitrade.dao.AwardDao;
import cn.ztuo.bitrade.entity.Award;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;

@Service
public class AwardService {

    @Autowired
    private AwardDao awardDao;

    public Award save(Award award){
        return awardDao.save(award);
    }

    public Award findByUidAndType(Long uid,Long status){
        return awardDao.findByUidAndType(uid,status);
    }

    /**
     * 按币种汇总当前的收益
     */
    public BigDecimal sumAward(String unit){
        return awardDao.sumAward(unit);
    }
}
